<@mits.headerDiv />
<div class="Main" id="Main">
	<!--屏幕切换-->
   
    
    
	<!--左边-->
	<!--右边-->
	<div class="Main_body" id="Main_body">

	
		<div class="Main_right_top">
		 <div class="Main_bodyListBar_head">搜索条件 </div>
		 <br>
		 <form name="userListForm" id ="userListForm" action="" method="post">
			<table border="0" cellspacing="1" cellpadding="0" class="addTable" >
					  
                        <tr>
                           <td class="title">用户姓名：</td>
                          <td class="content" >

						  <input type="text" name="userDto.name" id="userDto.name"  value="${userDto?if_exists.name?if_exists}" onkeypress="if(event.keyCode==13){search();}"   class="input_short" />
						  </td>
						  <td class="title">用户状态：</td>
                          <td class="content" >
						  <input type="radio" name="userDto.status" value="1" id="userDto.status" <#if userDto.status?if_exists ==1>checked</#if>   />有效
						  <input type="radio" name="userDto.status" value="0" id="userDto.status"  <#if userDto.status?if_exists ==0>checked</#if>    />禁用
						  </td>
 							<td class="content" >
						 <input type="button" onClick="search(0)" class="button" value="查询" />
						  </td>                          
                        </tr>
                         <tr>
						  <td class="title">用户账号：</td>
                          <td class="content" >
						  <input type="text" name="userDto.userName" value="${userDto?if_exists.userName?if_exists}" id="userDto.userName" onkeypress="if(event.keyCode==13){search();}"  class="input_short" />
						  </td>                         
                           <td class="title">所属部门：</td>
                          <td class="content" >

						 <select id="user.department.id" name="userDto.deptId">
			                <option value="-1" >请选择部门</option>
			               
			                <#if allDepartments?exists>
			                <#list allDepartments as department>
			                <option value="${department?if_exists.id?if_exists}" <#if userDto.deptId?exists><#if userDto.deptId == department.id >selected</#if></#if>>${department?if_exists.departmentName?if_exists}</option>
			                </#list>
			                </#if>
						  </td>

 							<td class="content" >
						 <input type="button" onClick="add()"  class="button" value="新增用户" />
						  </td>                          
                        </tr>                    
                      </table>
	 				</form>
			</div>
			
		<div class="Main_right_line">
		</div>
		
		  <div class="Main_bodyListBar">
				<div class="Main_bodyListBar_head">用户列表</div>
				<@mits.showActionMsg />
	    <div class="Main_bodyListBar_body">
				  <table border="0" cellpadding="0" cellspacing="0" class="listTable">
					<tr>					  
					  <th nowrap>用户账号</th>
					  <th nowrap>所属部门</th>
					  <th nowrap>用户姓名</th>
					  <th nowrap>是否有效</th>
					   <th nowrap>管理用户</th>
			        </tr>
					<tr>
					   <#if userResult?exists>
                        <#list userResult.content as user>					 
					  <td nowrap>${user.userName?if_exists?html}&nbsp;</td>
					  <td nowrap>${user?if_exists.department?if_exists.departmentName?if_exists?html}&nbsp;</td>
					  <td nowrap>${user.name?if_exists?html}&nbsp;</td>
					  <td nowrap><#if user.status?if_exists ==1>有效</#if><#if user.status?if_exists ==0>禁用</#if>&nbsp;</td>					 
			      	 <td nowrap><#if user.id?if_exists !=1> <a href="${base}/auth/system/assignUserPassPort.action?userId=${user.id?if_exists}">卡口管辖</a>&nbsp;</#if><a href="${base}/auth/system/editUser.action?cleanSucMsg=true&userId=${user.id?if_exists}">编辑</a><#if user.id?if_exists !=1>  <a href="javascript:void(0);onclick=deleteUser('${user.id?if_exists}')">删除</a></#if></td>
			      	</tr>
			      	</#list>
                    
			 <@mpage.fillLine pageSize, userResult.content.size(), 5/>
                <tr class="foot">
                  <td colspan="5">
                    <#assign page = userResult.page>
                    <script language = 'JavaScript'>
                        function changePage(cpage){
                           // window.location="${base}/auth/system/userList.action?cleanSucMsg=true&currentPage="+cpage;
                           search(cpage);
                        }
                    </script>
                    <@mpage.showPageInfo page/>
                  &nbsp;</td>
                </tr>                    
                 </#if>
				  </table>
			</div>
				</div>
			<div class="Main_bodyListBar_foot"></div>
		  </div>
		</div>
	
</div>
<script lanague ="javascript">
  function search(cpage) {
  
   $('userListForm').action = "${base}/auth/system/userList.action?cleanSucMsg=true&currentPage="+cpage;
   $('userListForm').submit();
  }
  function edit(userId) {
   window.location = "${base}/auth/system/initAddUser.action?cleanSucMsg=true";
  }  
  function add() {
   window.location = "${base}/auth/system/initAddUser.action?cleanSucMsg=true";
  }
  function deleteUser(userId) {
   if(confirm('确认删除吗？')){
    $('userListForm').action = "${base}/auth/system/deleteUser.action?&userId="+userId;
    $('userListForm').submit();
   } 
  }   
</script>
<@mits.footerDiv />


